package com.xiaochong.tir.common.data.mapper;


import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.xiaochong.tir.common.data.po.Navigation;

import java.util.List;

@Repository
public interface NavigationMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Navigation record);

    int insertSelective(Navigation record);

    Navigation selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Navigation record);

    int updateByPrimaryKey(@Param("record") Navigation record);

    /**
     * 根据父节点ID查询有效的子节点
     * @param parentId
     * @return
     */
    List<Navigation> selectByParentId(Integer parentId);
    
    List<Navigation>selectByEntityList(Navigation record);

    /**
     * 查询所有有效的父节点(按优先级rank排序)
     * @return
     */
    List<Navigation> selectByParent();

    /**
     * 查询所有有效的子节点(按所属父节点与优先级进行排序)
     * @return
     */
    List<Navigation> selectByChildren();

    int deleteNavByParentId(@Param("navId") Integer navId);

    Navigation selectByEntity(Navigation entity);
}